﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfMyText.UC;
namespace WpfMyText.VM
{
    public class UserSettingWindowVM : INotifyPropertyChanged
    {
        private ObservableCollection<object> _pages;
        public ObservableCollection<object> Pages
        {
            get { return _pages; }
            set
            {
                if (_pages != value)
                {
                    _pages = value;
                    OnPropertyChanged(nameof(Pages));
                }
            }
        }
        private int _selectedIndex;
        public int SelectedIndex
        {
            get { return _selectedIndex; }
            set
            {
                if (_selectedIndex != value)
                {
                    _selectedIndex = value;
                    OnPropertyChanged(nameof(SelectedIndex));
                }
            }
        }
        public UserSettingWindowVM()
        {
            Pages = new ObservableCollection<object>
            {
                new SystemPageUC(),
                new UserSettingUC()
            };
            SelectedIndex = 0; // 默认显示第一页
        }
        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
